﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Media.Animation;
using System.Windows;

namespace PresentationProject
{
    class MediaObject : MediaElement
    {
        private string id;
        public string Id
        {
            get
            {
                return id;
            }
            set
            {
                id = value;
            }
        }

        public void draw()
        {
            Visibility = System.Windows.Visibility.Visible;
        }

        public void disappear()
        {
            Visibility = System.Windows.Visibility.Hidden;
        }

        /*sb为新建动画所在的故事版， time为这段动画的持续时间*/
        public void appearslowly(Storyboard sb, int time)
        {
            DoubleAnimation imOpacity = new DoubleAnimation();
            imOpacity.To = 1.0;
            imOpacity.From = 0.0;
            imOpacity.Duration = TimeSpan.FromSeconds(time);
            Storyboard.SetTargetName(imOpacity, Name);
            Storyboard.SetTargetProperty(imOpacity, new PropertyPath(ImageObject.OpacityProperty));
            sb.Children.Add(imOpacity);
        }

        /*time为这段动画的持续时间*/
        public void appearslowly(int time)
        {
            DoubleAnimation imOpacity = new DoubleAnimation();
            imOpacity.To = 1.0;
            imOpacity.From = 0.0;
            imOpacity.Duration = TimeSpan.FromSeconds(time);
            BeginAnimation(OpacityProperty, imOpacity);
        }

        public void move(Thickness to, int time)
        {
            ;
        }

        public void changeSize()
        {
            ;
        }
    }
}
